index.md (1142B)
1 +++ 2 title = 'Morphological operations' 3 +++ 4 # Morphological operations 5 Useful for analysing shapes in images 6 Used on binary images 7 8 Operates by applying a kernel (structuring element of 0 and 1) to each pixel in input 9 10 there is a designated center pixel 11 12 instead of multiplication/addition, it is applied using a hit (dilation) or fit (erosion) operation 13 14 procedure: 15 1. Structuring element is placed on top of image 16 2. Center of structuring element is placed at position of pixel in focus 17 3. The value of that pixel is calculated by applying structuring element 18 19 operations 20 21 - dilation (increase in size) — center structuring element on each 0 pixel in image. if any in neighbourhood is 1, pixel is switched to 1. 22 23 ![screenshot.png](f29ae7fc6a951cebc39d401c516693ca.png) 24 25 - erosion (decrease in size) — center structuring element on each 1 pixel in image. if any in neighbourhood is 0, pixel is switched to 0. 26 27 ![screenshot.png](5823a4727aa3da50d8f101bd342ae265.png) 28 29 - opening (erosion => dilation) — removes small, isolated noisy objects 30 - closure (dilation => erosion) — removes small hole and join narrow isthmuses between objects